// home界面mock
import Mock from 'mockjs'


// bar
const bar = [
    {
        text: '关注',
        value: '关注'
    },
    {
        text: '推荐',
        value: '推荐'
    },
    {
        text: '热榜',
        value: '热榜'
    },
    {
        text: '视频',
        value: '视频'
    },
    {
        text: '深圳',
        value: '深圳'
    },
    {
        text: '健康',
        value: '健康'
    },
    {
        text: '科技',
        value: '科技'
    },
    {
        text: '图片',
        value: '图片'
    },
]


// 获取bar内容
Mock.mock('/api/home/bar', 'get', () => {
    return {
        code: '200',
        message: '获取bar',
        data: bar
    }
})

// 推荐_置顶新闻
const { recommend_top } = Mock.mock({
    'recommend_top|2': [
        {
            id: '@guid',
            title: '@ctitle(8, 20)',
            type: '0001',
            isTop: true,
            auther: '小默新闻',
            commit: '2222评论',
            time: '22小时前'
        }
    ]
})

// 获取推荐_置顶新闻
Mock.mock('/api/home/recommend/top', 'get', () => {
    return {
        code: '200',
        message: '推荐_置顶新闻获取',
        data: recommend_top
    }
})

// 推荐内容
const { recommend } = Mock.mock({
    "recommend": [
        {
            id: '@guid',
            title: '100公斤体重平均减17公斤！马斯克用的减肥“神药”国内上市，价格超千元！打针就能瘦？这些信息须掌握→',
            type: '0001',
            isTop: false,
            auther: '东风不破',
            commit: '27评论',
            time: '3小时前',
            img_preview: '@image("200x150", "#f66", "图片内容")',
            showUnlike: false
        },
        {
            id: '@guid',
            title: '“挺进”地球深部！我国首艘大洋钻探船“梦想”号正式入列',
            type: '0001',
            isTop: false,
            auther: '环球网',
            commit: '127评论',
            time: '6小时前',
            img_preview: '@image("200x150", "#f66", "图片内容")',
            showUnlike: false
        },
        {
            id: '@guid',
            title: '@ctitle(15,24)',
            type: '1000',
            auther: '@cname',
            time: '刚刚',
            img_preview: '@image("200x108","#f66","广告")',
            showUnlike: false
        },
        {
            id: '222222',
            title: '【Quin】黑暗之魂3 一周目攻略 Part21 古龙顶端【机核网】',
            type: '0002',
            isTop: false,
            auther: '米斯特奎恩',
            commit: '22222评论',
            time: '22小时前',
            img_preview: '@image("200x108", "#f66", "图片内容")',
            showUnlike: false
        },
        {
            id: '@guid',
            title: '与普京通话后朔尔茨重申德国将继续支持乌克兰，同时称“欧洲不能失去对俄交流渠道”',
            type: '0001',
            isTop: false,
            auther: '@cname',
            commit: '234评论',
            time: '1小时前',
            img_preview: '@image("200x150", "#f66", "图片内容")',
            showUnlike: false
        },
        {
            id: '@guid',
            type: '0003',
            username: '米斯特奎恩',
            text: '开㪍，入园免费厕所收费',
            commit: '82',
            time: '11月08日',
            img_preview: '/icon_home/6f65864188bca0744992c7cec138929b15810.png',
            recommend_num: '1502',
            is_subscribe: false,
            showUnlike: false
        }
    ]
})

// 获取推荐内容
Mock.mock('/api/home/recommend', 'get', () => {
    return {
        code: '200',
        message: '推荐内容',
        data: recommend
    }
})

// 热榜内容
const { hot } = Mock.mock({
    'hot': [
        {
            id: '@guid',
            title: '摸了',
            read_num: '2222万阅读',
            img_preview: '@dataImage("200x150")',
            auther: '米斯特奎恩'
        },
        {
            id: '@guid',
            title: '@ctitle(25,30)',
            read_num: '2189万阅读',
            img_preview: '@dataImage("200x150")',
            auther: '@cname'
        },
        {
            id: '@guid',
            title: '@ctitle(25,30)',
            read_num: '2176万阅读',
            img_preview: '@dataImage("200x150")',
            auther: '@cname'
        },
        {
            id: '@guid',
            title: '@ctitle(25,30)',
            read_num: '2174万阅读',
            img_preview: '@dataImage("200x150")',
            auther: '@cname'
        },
        {
            id: '@guid',
            title: '@ctitle(25,30)',
            read_num: '2170万阅读',
            img_preview: '@dataImage("200x150")',
            auther: '@cname'
        },
        {
            id: '@guid',
            title: '@ctitle(25,30)',
            read_num: '2158万阅读',
            img_preview: '@dataImage("200x150")',
            auther: '@cname'
        },
        {
            id: '@guid',
            title: '@ctitle(25,30)',
            read_num: '2157万阅读',
            img_preview: '@dataImage("200x150")',
            auther: '@cname'
        },
        {
            id: '@guid',
            title: '@ctitle(25,30)',
            read_num: '2154万阅读',
            img_preview: '@dataImage("200x150")',
            auther: '@cname'
        },
        {
            id: '@guid',
            title: '@ctitle(25,30)',
            read_num: '2149万阅读',
            img_preview: '@dataImage("200x150")',
            auther: '@cname'
        },
        {
            id: '@guid',
            title: '@ctitle(25,30)',
            read_num: '2133万阅读',
            img_preview: '@dataImage("200x150")',
            auther: '@cname'
        },
    ]
})

// 获取热榜内容
Mock.mock('/api/home/hot', 'get', () => {
    return {
        code: '200',
        message: '获取热榜',
        data:hot
    }
})

// 视频内容
const {home_video} = Mock.mock({
    'home_video|8': [
        {
            id: '@guid',
            title: '@ctitle(16, 24)',
            auther: '@cname',
            'time|1-24': 2,
            type: '0002a',
            'commit|50-200': 2,
            img_preview: '@dataImage("200x100")',
            is_subscribe: false,
        }
    ]
})

// 获取home_bar视频内容
Mock.mock('/api/home/video', 'get', () => {
    return {
        code: '200',
        messge: 'home_bar视频内容',
        data: home_video
    }
})